const http = require('../utils/http.js');

// 获取当前用户余额(可提现金额)
const getMyBalance = () => {
    return http.request('GET', '/Balance/current')
}

// 获取当前用户的收益
const getMyBenefits = () => {
    return http.request('GET', '/Balance/currentIncome')
}

// 获取收益详情
const getBenefitsDetail = () => {
    return http.request('GET', '/Balance/currentIncome/detail')
}

// 获取收益排行
const getRankList = (params) => {
    return http.request('GET', `/Balance/ranking?top=${params.top}&timeType=${params.timeType}`)
}

// 获取收益流水明细
const getBalanceDetail = (data) => {
    return http.request('POST', `/Balance/currentBalance/detail`, data)
}

// 提现
const withdrawal = (data) => {
    return http.request('POST', `/Balance/withdrawal`, data)
}

// 获取当前用户库存（库存列表）
const myStock = (data) => {
    return http.request('POST', `/AgentWarehouse/current/page`, data)
}

// 获取库存操作记录
const stockOptionRecord = (data) => {
    return http.request('POST', `/AgentWarehouse/record/page`, data)
}

module.exports = {
    getMyBalance,
    getMyBenefits,
    getBenefitsDetail,
    getRankList,
    getBalanceDetail,
    withdrawal,
    myStock,
    stockOptionRecord
}